import java.util.Scanner;

public class Practice01 {
    public static void main(String[] args) {
        //一个班级有若干学生，每个学生的成绩以整数表示。请实现一个程序，根据学生的成绩对他们进行排名并输出。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生人数：");
        int st = sc.nextInt();
        int[] score = new  int[st];
        System.out.println("请输入学生成绩：");
        for (int i = 0; i < score.length ; i++) {
            score[i] = sc.nextInt();
        }
        for (int i = 0; i < score.length ; i++) {
            int crue = i;
            for (int j = i; j < score.length ; j++) {
                if(score[crue] < score[j]){
                    crue = j;
                }
            }
            int temp = score[i];
            score[i] = score[crue];
            score[crue] = temp;
        }
        System.out.println("排名" + "\t" + "成绩");
        for (int i = 0; i < score.length ; i++) {
            System.out.println(i+1 + "\t" + score[i]);
        }
    }
}
